/*
 * PaintPrimitive.hpp
 *
 *  Created on: 2010-5-8
 *      Author: anod
 */

#ifndef PAINTPRIMITIVE_HPP_
#define PAINTPRIMITIVE_HPP_

#include <QList>
#include <QPoint>
#include <QMap>

namespace AppData
{

class PaintPrimitive
{
public:
	unsigned int      getType() const;
	const QString&    getName() const;
	const QPoint&     getVertex(int index) const;
	unsigned int      getVertexCount() const;
	void*             getAttribute(int key);
public:
	PaintPrimitive();
public:
	// 图元类型枚举
	enum{
		PRIMITIVE_ROUND,
		PRIMITIVE_POLIGON,
		PRIMITIVE_POINT,
		PRIMITIVE_LINE,
		PRIMITIVE_TEXT,
		PRIMITIVE_TIFF
	};

	// 图元控制属性枚举
	enum{
		ROUND_RADIUS
	};
private:
	void              SetType( unsigned int );
	void              SetName( QString& );
	void              PushVertex( QPoint );
	void              SetAttr(int key, void* val);
	void              Clean();
private:
	unsigned int      _type;//图元类型
	QString           _name;//图元名字
	QList<QPoint>     _vertex;//图元相关的顶点集
	QMap<int, void*>  _args;//图元绘制控制参数
	QString           _tooltip;//tooltip的id
};

}
#endif /* PAINTPRIMITIVE_HPP_ */
